package com.fire.chat.enums;


import com.fire.chat.cache.AuthorityCacheStrategy;
import com.fire.chat.cache.impl.LocalAuthorityCacheStrategy;
import com.fire.chat.cache.impl.RedisAuthorityCacheStrategy;

/**
 * @program: hxzq
 * @description: 缓存策略枚举
 * @author: xjr
 * @create: 2020-11-04 09:46
 **/
public enum CacheStrategyEnum {

    /**
     * 本地缓存,默认使用map
     *
     */
    LOCAL{
        @Override
        public Class<? extends AuthorityCacheStrategy> cache() {
            return LocalAuthorityCacheStrategy.class;
        }
    },

    /**
     * 分布式缓存,默认使用redis,后续有扩展再扩展此类
     *
     */
    DISTRIBUTED{
        @Override
        public Class<? extends AuthorityCacheStrategy> cache() {
            return RedisAuthorityCacheStrategy.class;
        }
    };

    public abstract Class<? extends AuthorityCacheStrategy> cache();
}
